import serviceType from "../../../../enum/service-type"
import behavior from "../behavior"
import cache from "../../../../enum/cache"
Component({
    behaviors: [behavior],
    properties: {
        service : {
            type : Object
        }
    },
    data: {
        serviceTypeEnum: serviceType,
        bgColor1: '#fff',
        bgColor2: '#fff'
    },
    methods: {
        handleChat: function (){
            this.triggerEvent("chat")
        },
        handleOrder : function (){
            this.triggerEvent("order")
            let token = wx.getStorageSync(cache.TOKEN)
            console.log(token);
            if(!token){
                wx.navigateTo({
                    url: '/pages/login/login',
                });
            }else{
                wx.navigateTo({
                    url: '/pages/order/order',
                });
            } 
        },
        handletouchstart1(){
            this.setData({
                bgColor1: '#ccc'
            })
        },
        handletouchend1(){
            this.setData({
                bgColor1: '#fff'
            })
        },
        handletouchstart2(){
            this.setData({
                bgColor2: '#ccc'
            })
        },
        handletouchend2(){
            this.setData({
                bgColor2: '#fff'
            })
        }
    }
});
